<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>商品详情</title>
		<link href="plugin/date/date.css" rel="stylesheet">
		<link href="bootstrap/css/bootstrap3.min.css" rel="stylesheet">
		<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
		<script src="js/jquery.min.js"></script>
		<link rel="stylesheet" href="css/nav.css"/>
		<style>
			.form-group-update {
				margin-right: 2%;
			}
			#bannerImg,#classificationImg{display: none;}
			.goodsBody {width: 90%; margin: 0 auto;}
			.goodsBody img {width: 100%;}
			#dataList th {min-width: 100px; }
			.imgInfo img {max-width: 100%;}
		</style>
	</head>

	<body>
		<!--导航!-->
	    <nav class="navbar navbar-inverse">
	      <div class="container-fluid">
	        <div class="navbar-header">
	          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
	            <span class="sr-only">Toggle navigation</span>
	            <span class="icon-bar"></span>
	            <span class="icon-bar"></span>
	            <span class="icon-bar"></span>
	          </button>
		          	<a class="navbar-brand" href=""><img src="images/admin_logo.png" alt=""></a>
	        </div>

	        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-2">
	          <ul class="nav navbar-nav" id="nav">

	          </ul>
	          <ul class="nav navbar-nav navbar-right">
	            <li class="dropdown">
	              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">欢迎您：<span id="uname"></span><span class="caret"></span></a>
	              <ul class="dropdown-menu" role="menu">
	                <li><a href="change_pass.html">修改密码</a></li>
	                <li><a id="loginOut" href="#">退出登陆</a></li>
	              </ul>
	            </li>
	          </ul>
	        </div>
	      </div>
	    </nav>
		<div class="container-fluid">
			<div class="row bcert-box">
				<ol class="breadcrumb">
				  <li><a href="javascript:;">主页</a></li>
				  <li>商品管理</li>
				  <li class="active">商品详情</li>
				</ol>
					 <div style="max-width: 1000px;margin: 0 auto;">
 			          	<table class="table table-bordered table-striped" id="dataList">

 			          	</table>
 			        </div>

		    </div>
		</div>
	</body>
</html>
<script type="text/javascript" src="plugin/layer/layer.js"></script>
<script type="text/javascript" src="js/cookie.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script>
	$(document).ready(function() {
		var id = getQueryString('id')
		data = {
			'goodsId':id,
		}
		var cbk = function (res){
			 var imglist = ''
			 var storeId = res.data.storeId;
			 var goodsImage = res.data.goodsImage;
			 if(storeId!=7){
				goodsImage = cncbk_common_tools.imgURL + goodsImage
			 }
			for (var i = 0; i < res.data.goodsImageList.length; i++) {
			imglist +=	'<div class="imgsBox"><img class="img-thumbnail" src="' + cncbk_common_tools.imgURL + res.data.goodsImageList[i].goodsImage +'" alt=""></div>'
			}
			var html =
			'<tr><th>商品id</th>'+
				'<td>' + res.data.goodsId +'</td>'+
			'</tr><tr><th>商品名称</th>'+
				'<td>' + res.data.goodsName +'</td>'+
			'</tr><tr><th>店铺名称</th>'+
				'<td>' + res.data.storeName +'</td>'+
			'</tr><tr><th>商品分类</th>'+
				'<td>' + res.data.gcId1 + res.data.gcId2+ res.data.gcId3+'</td>'+
			'</tr><tr><th>商品价格</th>'+
				'<td>' + res.data.goodsPrice +'</td>'+
			'</tr><tr><th>市场价</th>'+
				'<td>' + res.data.goodsMarketprice +'</td>'+
			'</tr><tr><th>库存</th>'+
				'<td>' + res.data.goodsStorage +'</td>'+
			'</tr><tr><th>运费</th>'+
				'<td>' + res.data.goodsFreight +'</td>'+
			'</tr><tr><th>物券价格</th>'+
				'<td>' + res.data.couponPrice +'</td>'+
			'</tr><tr><th>商品主图</th>'+
				'<td>'+
				'<div class="imgInfo" style="width:90%; margin:0 auto;"><img src="' + goodsImage +'" /><div>'+
				'</td>'+
			'</tr><tr><th>商品banner图</th>'+
				'<td>'+
					'<div  id="goodsBannerList" style="width:90%; margin:0 auto;">'+

					'</div>'+
				'</td>'+
			'</tr><tr><th>商品描述</th>'+
				'<td>' + res.data.goodsJingle +'</td>'+
			'</tr><tr><th style="vertical-align: top;">商品详情</th>'+
				'<td><div class="goodsBody">' + res.data.goodsBody +'</div></td>'+
			'</tr>'
			$('#dataList').append(html)
			$('#goodsBannerList').html(imglist);
		}
		ajax(
			serverURL+'/platform/queryGoodsById',
			data,
			cbk,
			'post',
			'json'
		)
	});
</script>
